﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace LynxBlogAPI.Models.Mapping
{
    public class CategoryDataMap : EntityTypeConfiguration<CategoryData>
    {
        public CategoryDataMap()
        {
            this.HasKey(t => t.categoryid);

            this.Property(t => t.categoryid).HasColumnName("CategoryId").HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            this.Property(t => t.username).HasColumnName("UserName").HasMaxLength(50).IsRequired();
            this.Property(t => t.title).HasColumnName("Title").HasMaxLength(50).IsRequired();
            this.Property(t => t.description).HasColumnName("Description").HasMaxLength(250);
            this.Property(t => t.htmlUrl).HasColumnName("HtmlUrl").HasMaxLength(250);
            this.Property(t => t.rssUrl).HasColumnName("RssUrl").HasMaxLength(250);
            this.ToTable("tblCategoryData");
        }
    }
}